UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WUX8fHAm9xO7ORvphH63whVJXpUwEX1yqVmkMR8125g=' 
WHERE 
  key_id = '1b2f8700e7013e6cdcd79c4ba820890ddce494339ad3729db28fcc688f59ae48' 
  AND (
    token = 'WUX8fHAm9xO7ORvphH63whVJXpUwEX1yqVmkMR8125g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019