UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Is9z9S8Yka0lReD0BF5xeFBKXwtTE3uH1dirTlLcyWw='
WHERE
key_id = '708e808038d57f83cf1e4232bf0fa58579d1b698dcd8fbf69ee320e96c268bee'
AND (
token = 'Is9z9S8Yka0lReD0BF5xeFBKXwtTE3uH1dirTlLcyWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)