UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VZQBNYxSrFM+oZdC9juUNaY1nMlDg1ha/OgLuNtlaAM='
WHERE
key_id = '05f50032ba1a45e1109e0c0ef69deb8c92b9862c482f3a8c42f7b9bc8ab311fa'
AND (
token = 'VZQBNYxSrFM+oZdC9juUNaY1nMlDg1ha/OgLuNtlaAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)