UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZuPUQLPOj7viLEJQs0QzQu8uNe63yaUtLh0vCIP0CcY='
WHERE
key_id = '9d063f4412a55d4f6c069a9647ac942df8dba1cffa404bac125f8749af3caf66'
AND (
token = 'ZuPUQLPOj7viLEJQs0QzQu8uNe63yaUtLh0vCIP0CcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)