UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wAWHBWVUik3nHkaISkuR/x9sXljtDUyOIE0HQ1eGHKM='
WHERE
key_id = '712573758299b9b88b84e881c93d0a9ac26280fd16c97352c8c8e1158dc3d875'
AND (
token = 'wAWHBWVUik3nHkaISkuR/x9sXljtDUyOIE0HQ1eGHKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)