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