UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vzae4U/VQoSLk799/dnH+RvNvwsz49jLgkLy6kzQSBE=' 
WHERE 
  key_id = 'd331fd9bd820c935854a8de2fc1a3b22f3f1a6b1fbbf0d631bbf58855d8c9569' 
  AND (
    token = 'vzae4U/VQoSLk799/dnH+RvNvwsz49jLgkLy6kzQSBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080