UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '23Eowib9n0ax3XHicbX2GwkdEbkOIlzVMH3hZ12jv5s=' 
WHERE 
  key_id = '06999df9db949f250d5e55efdd3f5075ed8f9dcecc2bba22fc34f03e91d006e1' 
  AND (
    token = '23Eowib9n0ax3XHicbX2GwkdEbkOIlzVMH3hZ12jv5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020