UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZfOnzzjaJMuNhnsBGPxTR8WyWew+tecqVvTZVSOmyzs=' 
WHERE 
  key_id = '73809bf2b5b8e5b3a9f99c430e9594532b41c62ecf0aeb6097a9eaad89854349' 
  AND (
    token = 'ZfOnzzjaJMuNhnsBGPxTR8WyWew+tecqVvTZVSOmyzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025