UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mZVgbpGFrAkFn99Qez6KCAAaKuvl03h/0O1zAWE8Ntw='
WHERE
key_id = '03bdb7b519ac62ab0914d0863050087080e06ad99337aa6663da0765e63dc72d'
AND (
token = 'mZVgbpGFrAkFn99Qez6KCAAaKuvl03h/0O1zAWE8Ntw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)