UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q8NSu02yK9NnjB5zEehU+fqPkPMu9hfWRX+wclxu3mE='
WHERE
key_id = 'a8ca1a8b3d633e6b70afd699a017a20d75532414b278a738343fd0d7b9bd4a08'
AND (
token = 'q8NSu02yK9NnjB5zEehU+fqPkPMu9hfWRX+wclxu3mE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)