UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LITUu96A/OXLVjUzxE2v2G6TN7YIU4DTAa4zve3AIOU='
WHERE
key_id = '1e52abe757bce8892f5de4e58f041419a4ea6c92ef284590c693eed02c139cf0'
AND (
token = 'LITUu96A/OXLVjUzxE2v2G6TN7YIU4DTAa4zve3AIOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)