UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kqXHxBhb6xTLxH0Vk2TjcXTjxFdvSiARglynRWdn/oA='
WHERE
key_id = '3df5fb82ab031dad087660ef4eaa9e9da98cd856b85ff580a101f992e73bc95c'
AND (
token = 'kqXHxBhb6xTLxH0Vk2TjcXTjxFdvSiARglynRWdn/oA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)