UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'alzVIUg+hTjMPEhkZF76JzXdHN0tvCDZBZbAZKLpxcU='
WHERE
key_id = 'ceb0859bb28dc69ea39bbdf810141124720c884e738b27a33fd0ade33e464142'
AND (
token = 'alzVIUg+hTjMPEhkZF76JzXdHN0tvCDZBZbAZKLpxcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)