UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aHY9YInTslW9lqmHhKjdS3PjMqgWX9Xl4EK3AOAJDpQ='
WHERE
key_id = '0fb0862967dae4e9dbb480ab7db9a35ace03d3e8caa7b8e3cab570777ef9fb6c'
AND (
token = 'aHY9YInTslW9lqmHhKjdS3PjMqgWX9Xl4EK3AOAJDpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)