UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lH2Mau9paw/NlwYH0TaCJBeO9Czb631+J2fuAuqgIQk='
WHERE
key_id = '64ac25401b45dadbd9711b75d42cfefc61c900e71a952f1a0e8a80e471111554'
AND (
token = 'lH2Mau9paw/NlwYH0TaCJBeO9Czb631+J2fuAuqgIQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)