UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUVwQyX/vk6kMzuDHV1Ut+SZVtviJVZkk24mGCJshPo=' 
WHERE 
  key_id = 'cb2d7dd8711cca5fd89ac7c3e08d8a627e86d04337e4d79b34af7ade8c6b10b6' 
  AND (
    token = 'EUVwQyX/vk6kMzuDHV1Ut+SZVtviJVZkk24mGCJshPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023