UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZ7aBHpMIDAP3OAVp0OOGAupENbjLatEPwJ1nWWK7HE=' 
WHERE 
  key_id = '8ea24c65471ed75b410ec6c8075c64685ead25ba0aa831f0dec29e46ef329886' 
  AND (
    token = 'MZ7aBHpMIDAP3OAVp0OOGAupENbjLatEPwJ1nWWK7HE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033