UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dn3txm5T2CsvDs4Mi1tr1nncICWWtZ17/IE9LhATelU=' 
WHERE 
  key_id = '11290f74cf8a59bf61388f49b79570ab1a37914c0823f442a75b7604d478b10a' 
  AND (
    token = 'Dn3txm5T2CsvDs4Mi1tr1nncICWWtZ17/IE9LhATelU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036