UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L3qgxeKVIjJec+GVMf85DAlBxGtYtzPkWpmdZyWQG7E='
WHERE
key_id = '2d183f5448391926cb063c3361704155f0c6f8150e41cc5fc94bf2601cc981a8'
AND (
token = 'L3qgxeKVIjJec+GVMf85DAlBxGtYtzPkWpmdZyWQG7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)