UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lmHWKnlGVoEPUBX0n4zsyaR9GJdXROA9FvytXekw7f4='
WHERE
key_id = '46f77a99b89ceab6c9ce358e5fc864d6d9a01cadb373d3abf2b4952aaa1c6915'
AND (
token = 'lmHWKnlGVoEPUBX0n4zsyaR9GJdXROA9FvytXekw7f4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)