UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77pbnG8FeSFi51z0m6K2ED2/NrqUz5deuhXHpm2xT40=' 
WHERE 
  key_id = '96beee751753db7a3c1ad4b04ccda0544b6032389afaa5b345a19bf813f1ed74' 
  AND (
    token = '77pbnG8FeSFi51z0m6K2ED2/NrqUz5deuhXHpm2xT40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017