UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WEghU+shL5Aw9/iOACQ+DIef/SeKXpb1NOXgJHnhzmU='
WHERE
key_id = '3d00956a9982fc9b240a361fe3767a0c4652851da5192f37bf92cab7eea1af48'
AND (
token = 'WEghU+shL5Aw9/iOACQ+DIef/SeKXpb1NOXgJHnhzmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)