UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vtmu6OUgbgfKtxxMZ7TzdluI1wpTbljMWb7xLXyawqA='
WHERE
key_id = 'ed7296d56bcc0e4f8e3a83100cb9cc82d0b73ec6b43497af2e9587e7dde9b538'
AND (
token = 'Vtmu6OUgbgfKtxxMZ7TzdluI1wpTbljMWb7xLXyawqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)