UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iiJ6USVEBwa2cYgmZUsyxugoQZJc0kuf0e702aIfgUM='
WHERE
key_id = 'd833ca4370b5f51dc297ebc428514c9077c993afd69890fbaa273eec7b3733fa'
AND (
token = 'iiJ6USVEBwa2cYgmZUsyxugoQZJc0kuf0e702aIfgUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)