UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DhYSTZntlwSAhQwEWqVLBsmtvio/pPVgOoVEqTt9P0='
WHERE
key_id = '76d8df94a1e920f8a7003746f1789b5dbfac02c7333af0bf46e00bbad19cbcf6'
AND (
token = '3DhYSTZntlwSAhQwEWqVLBsmtvio/pPVgOoVEqTt9P0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)