UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZTCQro/X8DYDhSqaxlkglndWz6moQX8DDOiAPXtHE3I=' 
WHERE 
  key_id = '82a11c62d940a4d3adb0d5ce3ab8b42ba5b10fd60b6973caf8ed0c8b88992cca' 
  AND (
    token = 'ZTCQro/X8DYDhSqaxlkglndWz6moQX8DDOiAPXtHE3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033