UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N48YxNM5oerZXY9y8CjJSEwHx9WesUkKigOzrO3qtNM='
WHERE
key_id = 'e3b79b21f37a4476358181bf4132d925fb86d84ad6f827a36c5d88a27b1decba'
AND (
token = 'N48YxNM5oerZXY9y8CjJSEwHx9WesUkKigOzrO3qtNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)