UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qqt0IOZHoShGCK5E9rHxq63NJJ73UgTtdWE+J92jT6k='
WHERE
key_id = 'c6e15c452f40b9f78a26f435b5ffec695b62469bc08852e4972091121e403179'
AND (
token = 'qqt0IOZHoShGCK5E9rHxq63NJJ73UgTtdWE+J92jT6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)