UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UGU/dshgLCT+lxNRPJNbb2Ko4SNPbPRW7UbJ7OFXUuY=' 
WHERE 
  key_id = 'ea566179ae60303a88153a8e9dbef1f9c36b7c388955c3bbefdec07a025baa1e' 
  AND (
    token = 'UGU/dshgLCT+lxNRPJNbb2Ko4SNPbPRW7UbJ7OFXUuY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033