UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sflPQwq0hDy3qE+X80v+azWATfelUGbzqeI4OW3iMAc='
WHERE
key_id = 'cc7fb7e2a5df007efe4211d4dba1ec0a209e8ea03db6ae49d12a3e6375fda398'
AND (
token = 'sflPQwq0hDy3qE+X80v+azWATfelUGbzqeI4OW3iMAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)