UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9D53s3rR/CpGNfwYpYfz8JyIsQVZccMvMCMB4vy2WCc=' 
WHERE 
  key_id = '3362af600189cf2120620328bde8c8bc48aacffa0d3d18424e949ce60922982d' 
  AND (
    token = '9D53s3rR/CpGNfwYpYfz8JyIsQVZccMvMCMB4vy2WCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017