UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOq5AbWXRron+hcSkfusCKThalxvDkh8gwYwU//dl8Q='
WHERE
key_id = 'cf4faf193132ed98dc298a442fd7e9b9ae0258e8aa54c318e563642c810a1bff'
AND (
token = 'ZOq5AbWXRron+hcSkfusCKThalxvDkh8gwYwU//dl8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)