UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HZbtvA7r/vViFCvZTtzMmQAGlJRi9PbpcHXYnHUJMU='
WHERE
key_id = 'f232a6e96e0714fe32abff21ce832000352da7e5f1997a05eaa7cc15c1868074'
AND (
token = '6HZbtvA7r/vViFCvZTtzMmQAGlJRi9PbpcHXYnHUJMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)