UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XHKLwjZ5byG9P3S+wv2xNOEV3KQuq7CQ10uIMJy2UqU='
WHERE
key_id = '52b2018e75aaa3a60260ed223397773d6a8bd3407fdaa7681fa5d6dae0a5d0d9'
AND (
token = 'XHKLwjZ5byG9P3S+wv2xNOEV3KQuq7CQ10uIMJy2UqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)