UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZybnL8HfdE9CGrPF+8h5lp4IWJkuOtgtiN7J8r6xva8='
WHERE
key_id = 'caf5fe7da9bce080b4e4d75cc4c872c1819268a2810bb32cf17cea4959b5abb6'
AND (
token = 'ZybnL8HfdE9CGrPF+8h5lp4IWJkuOtgtiN7J8r6xva8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)