UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9dH6Pd1uTRX4sUDsZqGeM8wrz0w4nJQDw7BmaRBsOb4=' 
WHERE 
  key_id = '78abd8a60c40b6ca07dfdd878801a64e568d9e355152677fe92991ef8070429a' 
  AND (
    token = '9dH6Pd1uTRX4sUDsZqGeM8wrz0w4nJQDw7BmaRBsOb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026