UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jOg7DkdicmW4z5xWrBHMd7p7vs0JYXMMU2f3r2KTgqM='
WHERE
key_id = '96d7cbd139bc13f6465a78d0124a8a22986d315b92cf115da3fc07d37daf62e4'
AND (
token = 'jOg7DkdicmW4z5xWrBHMd7p7vs0JYXMMU2f3r2KTgqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)