UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Z6AVvjbUfb4YSKZVjd0dacwYc7notUHZc5jp6pHgFg='
WHERE
key_id = '0e4b07889c1c4a49ebac3b18d23dc7711320ac6c18707ecb0a54b7318311ef29'
AND (
token = '9Z6AVvjbUfb4YSKZVjd0dacwYc7notUHZc5jp6pHgFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)