UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8UI9HiQC4kR6sqO4qHWQ04AAdk4VWK9Ozk3SOnoME0g='
WHERE
key_id = 'd4fffdfea31380c45095478da29dadcf18c5e4da129c959ad48da06707357217'
AND (
token = '8UI9HiQC4kR6sqO4qHWQ04AAdk4VWK9Ozk3SOnoME0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)