UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y7xVnmJQs+Nm6TJiLferWCFTm/TS2KTBjqehNgPg2cs='
WHERE
key_id = '89c1de320ba3434fe9d613b4298b2b189779b5e37e8efd3c0a4dad5fc86b8506'
AND (
token = 'Y7xVnmJQs+Nm6TJiLferWCFTm/TS2KTBjqehNgPg2cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)