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