UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UR3uBFqduFF/knfe6WcVKwzFjqFUxG4Ya9yWb5NS5t8='
WHERE
key_id = '01a80378bba0f970af1c706da9af3187f8f58ebbe10addb2084a68c0bdd4910b'
AND (
token = 'UR3uBFqduFF/knfe6WcVKwzFjqFUxG4Ya9yWb5NS5t8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)