UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMilvo3fRu6p9eZl/fUsidCS1lfSQzV5qbZKr2/vMys=' 
WHERE 
  key_id = 'e2dbdffc9356ce7586303c4fbdb4582ff0f189dd8758a4785d8de1abf8a7a8e2' 
  AND (
    token = 'ZMilvo3fRu6p9eZl/fUsidCS1lfSQzV5qbZKr2/vMys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035