UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D1QtAF9l//AvOJYX/w9bxx4+YGkC/twvRbh6h5B79SY='
WHERE
key_id = '879927144b6eaf09c9fdbd8601e4c1c8b9abd1970ece5a3c1181945f94b043c3'
AND (
token = 'D1QtAF9l//AvOJYX/w9bxx4+YGkC/twvRbh6h5B79SY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)