UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dHNqacWwKIPuLAU2U5tK4cimaYp3SVpsXQfxh4vlkHw='
WHERE
key_id = '35943b0fa0c924ee0fd46c3157c81b36e6ddd423934128ffda05870c01c15425'
AND (
token = 'dHNqacWwKIPuLAU2U5tK4cimaYp3SVpsXQfxh4vlkHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)