UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cLejPeKhxH7YqCzI2yMVh7evkH3TRg/GJjKQraA+6Ik='
WHERE
key_id = 'b337740fdeff33a737662cc949527b3e901b9ec4d2b8fc632bdd454cc9f92e85'
AND (
token = 'cLejPeKhxH7YqCzI2yMVh7evkH3TRg/GJjKQraA+6Ik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)