UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZHWJIs+2/pqGu8uZDbwdQc7/SEnCttv0fD5dPhyJies=' 
WHERE 
  key_id = '7e0be7d94c6900b573a60cbcd4b32c09c689aa8f7e6c61b9e6f0cdfbd0e53619' 
  AND (
    token = 'ZHWJIs+2/pqGu8uZDbwdQc7/SEnCttv0fD5dPhyJies=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030