UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9/IttqusCAqrhW2rAsS1xkfTK2YVLx2Li9txZ/10ffQ='
WHERE
key_id = '849da1ea35f02a4d1604c9aa8b39b4b3241bcf7f5c2e046f675f9e0397595f0e'
AND (
token = '9/IttqusCAqrhW2rAsS1xkfTK2YVLx2Li9txZ/10ffQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)