UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XIfSKBsDHO23lVQOncaFOvxHfFZZ0rXst5EzcRgTquQ=' 
WHERE 
  key_id = '13a801f681257575b823383e303eb550d313f78854edac641a21acfb73a292c3' 
  AND (
    token = 'XIfSKBsDHO23lVQOncaFOvxHfFZZ0rXst5EzcRgTquQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022