UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MZ8RYxzIihu62Odqd1/cZZaFkNWByb0Sv82TBHIhN30='
WHERE
key_id = 'c3551206f20fc4b473b8b7d7a1a601719e42ba3b7e0e7d960e44c9c9ab35998e'
AND (
token = 'MZ8RYxzIihu62Odqd1/cZZaFkNWByb0Sv82TBHIhN30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)